﻿// -------------------------------------------------------------------------
//    @FileName         :    NFWelfareModule.cpp
//    @Author           :    gaoyi
//    @Date             :    2025-07-11
//    @Email			:    445267987@qq.com
//    @Module           :    NFWelfareModule
//
// -------------------------------------------------------------------------

#include "NFWelfareModule.h"

#include "NFWelfareMgr.h"
#include "proto_svr_world.nanopb.h"

NFWelfareModule::NFWelfareModule(NFIPluginManager* p): NFMMODynamicModule(p)
{
}

NFWelfareModule::~NFWelfareModule()
{
}

int NFWelfareModule::Awake()
{
    return 0;
}

int NFWelfareModule::Tick()
{
    return 0;
}

int NFWelfareModule::OnDynamicPlugin()
{
    return 0;
}

int NFWelfareModule::OnHandleServerMessage(uint64_t unLinkId, NFDataPackage& packet)
{
    if (!m_pObjPluginManager->IsInited(NF_ST_LOGIC_SERVER))
    {
        NFLogError(NF_LOG_DEFAULT, packet.nParam1, "Logic Server not inited, drop client msg:{}", packet.ToString());
        return -1;
    }

    if (m_pObjPluginManager->IsServerStopping())
    {
        NFLogError(NF_LOG_DEFAULT, packet.nParam1, "Logic Server is Stopping, drop client msg:{}", packet.ToString());
        return -1;
    }

    return 0;
}




